package tech.aistar.mapper;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import tech.aistar.pojo.entity.Orders;

import java.util.List;

@Repository
@Mapper
public interface OrderMapper {
    @Insert("insert into orders(userid, ordernum, orderstatus, orderprice,paidamount, vip, vipstatus, createtime) VALUES (#{userid},#{ordernum},#{orderstatus},#{orderprice},#{paidamount},#{vip},#{vipstatus},#{createtime})")
    void ins(int userid,String ordernum,int orderstatus,String orderprice,String paidamount,String vip,int vipstatus,String createtime);
    @Select("select *from orders where userid=#{value}")
    Orders seltid(int uid);
    @Select("select *from orders where ordernum=#{value}")
    Orders seltonum(String ordernum);
    @Update("update orders set orderstatus=#{orderstatus},paidamount=#{paidmount},vip=#{vip},vipstatus=#{vipstatus},createtime=#{createtime} where ordernum=#{ordernum}")
    void updat(@Param("orderstatus") int orderstatus,@Param("paidmount") String paidmount,@Param("vip")String vip,@Param("vipstatus")int vipstatus,@Param("createtime")String createtime,@Param("ordernum")String ordernum);

}
